﻿using MyX.Bus;
using MyX.Core;
using MyX.Store;
using MyX.DSL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LearningEnglish.Models;

namespace LearnningEnglish.Test
{
    public class TestStaticConfig
    {
        static TestStaticConfig()
        {
            InitObject = new object();

            //不因依赖于消息队列来进行单元测试
            //XMQ.Start();
            //XDSLScan.Scan(typeof(LearnUser).Assembly);
            
            XRepositoryCommon.SetCommandRepository(() => new XMemoryRepository());
            XRepositoryCommon.SetEventRepository(() => new XMemoryRepository());

        }

        /// <summary>
        /// 引用该方法，触发全局静态初始化
        /// </summary>
        public static void Init()
        {
            var i = InitObject;
        }

        private static object InitObject { get; set; }
    }
}
